<?php
global $_RQ,$_AR;
$_RQ['op']=$_RQ['op']?$_RQ['op']:'list';
$return=array();
if($_RQ['op']=='list'){
	$pindex = max(1, intval($_RQ['page']));
	$psize = 15;
	$params=array('uniacid'=>$_SESSION['uniacid'],'status'=>0);	
	$fields=array('id','logo','mobile','realname','status','merchname');
    $orderby='id desc';
	$total='';
	$return['list']=pdo_getslice('jy_supplier_user',$params,array($pindex,$psize),$total,$fields,'',$orderby);
	$totalpage=ceil($total/$psize);
	$totalpage=intval($totalpage);
	$return['totalpage'] =$totalpage;
	$return['params']['page'] =$pindex;
	foreach($return['list'] as &$v){
	}
	$return['status']=array('0'=>array('id'=>0,'title'=>'待入驻'),'1'=>array('id'=>1,'title'=>'入驻中'),'2'=>array('id'=>2,'title'=>'暂停中'));
	$htmls=array(
		'type'=>'list',
		'tabs'=>array(
			array('op'=>'list','title'=>'供货商申请'),
			
		),
		'list'=>array('data'=>'list','del_one'=>false,'delall'=>false,'edit'=>false,'list'=>array(
			array('name'=>'merchname','title'=>'名称','type'=>'string'),			
			array('name'=>'mobile','title'=>'电话','type'=>'string'),
			array('name'=>'realname','title'=>'姓名','type'=>'string'),						
		),
		'action'=>array(	
			array('type'=>'href','op'=>'da','title'=>'通过','show'=>array('status'=>0)),
			array('type'=>'href','op'=>'ju','title'=>'拒绝','show'=>array('status'=>0)),
			
		)
		
		),
		
	);
	
	$return['htmls']=$htmls;
	exi($return);
}
if($_RQ['op']=='da'){
	$id=intval($_RQ['id']);
	pdo_update('jy_supplier_user',array('status'=>1,'jointime'=>time()),array('id'=>$id));
	exi('已确认通过','','list');	
}
if($_RQ['op']=='ju'){
	$id=intval($_RQ['id']);
	pdo_update('jy_supplier_user',array('status'=>2),array('id'=>$id));
	exi('已确认拒绝','','list');	
}
?>